home *** CD-ROM | disk | FTP | other *** search
- #include "../CGVPMacro.csi"
-
- MainInput { uniform samplerCUBE refrMapR : texunit0,
- uniform samplerCUBE refrMapG : texunit1,
- uniform samplerCUBE refrMapB : texunit2,
- uniform samplerCUBE reflMap : texunit3,
- uniform float4 Opacity }
- DeclarationsScript
- {
- OUT_T0_T1_T2_T3_C0
- FOUT
- }
- CoreScript
- {
- // load the reflection map
- float4 reflColor = texCUBE(reflMap, IN.Tex3.xyz);
- // load the refraction map
- float3 cubeR = texCUBE(refrMapR, IN.Tex0.xyz).xyz;
- float3 cubeG = texCUBE(refrMapG, IN.Tex1.xyz).xyz;
- float3 cubeB = texCUBE(refrMapB, IN.Tex2.xyz).xyz;
- float3 refrColor;
- refrColor.r = cubeR.r;
- refrColor.g = cubeG.g;
- refrColor.b = cubeB.b;
- float3 env = reflColor.xyz*IN.Color.xyz + refrColor.xyz*(1-IN.Color.xyz);
- // finally add them all together
- OUT.Color.xyz = env.xyz;
- OUT.Color.w = Opacity.a * IN.Color.a;
- }
-
-
-